﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Apex.Common;
using Apex.Common.IO;
using Apex.Script.Models;
using Skript = Apex.Script.Models.Script;

namespace Apex.Script.IO
{
    public class ScriptReader : ApexFileReader<Skript>
    {
#warning Current implementation provides a test templated, generated in code. Implement this ASAP
#warning Implement with view models
        public override Skript ReadObject(string path)
        {
            Location l = new Location();
            l.ActualDate = DateTime.Now.TimeOfDay;
            l.ID = 67;
            l.Name = "River's Heart";
            l.Position = new LatLon(47.1518166, 27.5878188);
            l.TimeOfDay = TimeOfDay.MidDay;
            l.Weather = WeatherType.Sunny;

            Character c1 = new Character()
            {
                Backstory = "Idiot",
                ID = 362,
                Name = "Vasile"
            };

            Character c2 = new Character()
            {
                Backstory = "Idiot",
                ID = 562,
                Name = "Marinica"
            };

            Skript rval = new Skript();
            rval.Author = "Ionica Popescu";
            rval.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
            rval.Name = "Return of Mothman";
            rval.ID = 0;
            rval.ProductionCompany = "WarCry Studios";
            rval.Version = 2;

            SequenceGroup sg1 = new SequenceGroup();
            sg1.Name = "Act 1";
            sg1.ID = 1;

            Sequence seq1 = new Sequence();
            seq1.ID = 3;
            seq1.Name = "Sequence 1";

            Scene sc1 = new Scene();
            sc1.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
            sc1.ID = 4;
            sc1.Location = new Location();
            sc1.Name = "Scene 1";
            sc1.Location = l;

            SceneDescription scd1 = new SceneDescription();
            scd1.Description = "Lorem ipsum dolar sit amet";
            scd1.ID = 5;

            SceneDialogue scdiag1 = new SceneDialogue();
            scdiag1.ID = 6;
            scdiag1.Items.Add(new DialogueItem() { Character = c1, Directions = "SHOUT!", Line = "You mad bro?" });

            SceneDialogue scdiag2 = new SceneDialogue();
            scdiag2.ID = 616;
            scdiag2.Items.Add(new DialogueItem() { Character = c2, Directions = "SHOUT!", Line = "No bro." });

            sc1.Items.Add(scd1);
            sc1.Items.Add(scdiag1);
            sc1.Items.Add(scdiag2);
            seq1.Items.Add(sc1);
            sg1.Items.Add(seq1);
            rval.Items.Add(sg1);
            rval.Locations.Add(l);
            rval.Locations.Add(new Location()
            {
                ActualDate = DateTime.Now.TimeOfDay,
                Name = "Palas",
                Position = new LatLon(47.1562462, 27.5875544),
                TimeOfDay = TimeOfDay.MidDay,
                Weather = WeatherType.Raining,
            });
            rval.Locations.Add(new Location()
            {
                ActualDate = DateTime.Now.TimeOfDay,
                Name = "Alta Parte",
                Position = new LatLon(47.1573187, 27.5826942),
                TimeOfDay = TimeOfDay.MidDay,
                Weather = WeatherType.Windy,
            });

            return rval;
        }
    }
}
